Optimal. Leaf size=52 \[ -\frac{a^2 \tanh ^{-1}(\cos (e+f x))}{f}+\frac{b (2 a-b) \sec (e+f x)}{f}+\frac{b^2 \sec ^3(e+f x)}{3 f} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0549429, antiderivative size = 52, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.143, Rules used = {3664, 390, 207} \[ -\frac{a^2 \tanh ^{-1}(\cos (e+f x))}{f}+\frac{b (2 a-b) \sec (e+f x)}{f}+\frac{b^2 \sec ^3(e+f x)}{3 f} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3664
Rule 390
Rule 207
Rubi steps
\begin{align*} \int \csc (e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx &=\frac{\operatorname{Subst}\left (\int \frac{\left (a-b+b x^2\right )^2}{-1+x^2} \, dx,x,\sec (e+f x)\right )}{f}\\ &=\frac{\operatorname{Subst}\left (\int \left ((2 a-b) b+b^2 x^2+\frac{a^2}{-1+x^2}\right ) \, dx,x,\sec (e+f x)\right )}{f}\\ &=\frac{(2 a-b) b \sec (e+f x)}{f}+\frac{b^2 \sec ^3(e+f x)}{3 f}+\frac{a^2 \operatorname{Subst}\left (\int \frac{1}{-1+x^2} \, dx,x,\sec (e+f x)\right )}{f}\\ &=-\frac{a^2 \tanh ^{-1}(\cos (e+f x))}{f}+\frac{(2 a-b) b \sec (e+f x)}{f}+\frac{b^2 \sec ^3(e+f x)}{3 f}\\ \end{align*}
Mathematica [A] time = 0.167076, size = 66, normalized size = 1.27 \[ \frac{3 a^2 \left (\log \left (\sin \left (\frac{1}{2} (e+f x)\right )\right )-\log \left (\cos \left (\frac{1}{2} (e+f x)\right )\right )\right )+3 b (2 a-b) \sec (e+f x)+b^2 \sec ^3(e+f x)}{3 f} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] time = 0.05, size = 124, normalized size = 2.4 \begin{align*}{\frac{{b}^{2} \left ( \sin \left ( fx+e \right ) \right ) ^{4}}{3\,f \left ( \cos \left ( fx+e \right ) \right ) ^{3}}}-{\frac{{b}^{2} \left ( \sin \left ( fx+e \right ) \right ) ^{4}}{3\,f\cos \left ( fx+e \right ) }}-{\frac{{b}^{2} \left ( \sin \left ( fx+e \right ) \right ) ^{2}\cos \left ( fx+e \right ) }{3\,f}}-{\frac{2\,{b}^{2}\cos \left ( fx+e \right ) }{3\,f}}+2\,{\frac{ab}{f\cos \left ( fx+e \right ) }}+{\frac{{a}^{2}\ln \left ( \csc \left ( fx+e \right ) -\cot \left ( fx+e \right ) \right ) }{f}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.05444, size = 92, normalized size = 1.77 \begin{align*} -\frac{3 \, a^{2} \log \left (\cos \left (f x + e\right ) + 1\right ) - 3 \, a^{2} \log \left (\cos \left (f x + e\right ) - 1\right ) - \frac{2 \,{\left (3 \,{\left (2 \, a b - b^{2}\right )} \cos \left (f x + e\right )^{2} + b^{2}\right )}}{\cos \left (f x + e\right )^{3}}}{6 \, f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 2.03636, size = 228, normalized size = 4.38 \begin{align*} -\frac{3 \, a^{2} \cos \left (f x + e\right )^{3} \log \left (\frac{1}{2} \, \cos \left (f x + e\right ) + \frac{1}{2}\right ) - 3 \, a^{2} \cos \left (f x + e\right )^{3} \log \left (-\frac{1}{2} \, \cos \left (f x + e\right ) + \frac{1}{2}\right ) - 6 \,{\left (2 \, a b - b^{2}\right )} \cos \left (f x + e\right )^{2} - 2 \, b^{2}}{6 \, f \cos \left (f x + e\right )^{3}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \left (a + b \tan ^{2}{\left (e + f x \right )}\right )^{2} \csc{\left (e + f x \right )}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.70784, size = 197, normalized size = 3.79 \begin{align*} \frac{3 \, a^{2} \log \left (-\frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1}\right ) + \frac{8 \,{\left (3 \, a b - b^{2} + \frac{6 \, a b{\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} - \frac{3 \, b^{2}{\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} + \frac{3 \, a b{\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}}\right )}}{{\left (\frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1} + 1\right )}^{3}}}{6 \, f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]